package cn.xinfei.xdecision.data;

import cn.xinfei.xdecision.model.CreditVarRequest;
import cn.xinfei.xdecision.model.CreditVarResponse;
import cn.xinfei.xdecision.model.VariableApiRequest;
import cn.xinfei.xdecision.model.VariableApiResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/*192.168.9.181:8082*/
//@FeignClient(value="${xinyongfei.interface.data-server}", fallbackFactory =RiskDApiFallbackFactory.class)
//@FeignClient(value="${xinyongfei.interface.data-server}",url =  "192.168.9.181:8082", fallbackFactory =RiskDApiFallbackFactory.class)
//@FeignClient(value="${xinyongfei.interface.data-server}",url = "192.168.9.226:8082", fallbackFactory =RiskDApiFallbackFactory.class)
//@FeignClient(value="${xinyongfei.interface.data-server}",url = "10.10.200.119:8082")
//@FeignClient(value="xdecision-data-server",url = "192.168.9.226:8082")
//@FeignClient(value="xdecision-data-server",url =  "192.168.9.181:8082")
//@FeignClient(value="xdecision-data-server",url =  "10.10.100.45:8082")
//@FeignClient(value="xdecision-data-server",url =  "localhost:8082",contextId = "credit-data")
@FeignClient(value = "xdecision-data-server", contextId = "credit-data")
@Component
//线上调用时不可配置熔断，失败了就进入pending状态
public interface CreditDataApiInterface {

    @RequestMapping(value = "/data/creditCollect", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    CreditVarResponse creditCollect(@RequestBody CreditVarRequest creditVarRequest);

    @RequestMapping(value = "/data/fetchCreditVars", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    VariableApiResponse fetchCreditVars(@RequestBody VariableApiRequest variableApiRequest);

}
